const express = require('express');
const axios = require('axios');
const router = express.Router();

/* GET home page. */
router.get('/', async function(req, res, next) {

  // Use AJAX to fetch dynamic data and update the HTML content
  const response = await axios.get('http://example.com/');
        
  res.render('index', { title: 'Express', content: response.data });
});

module.exports = router;
